package com.hl.service;

import com.hl.mapper.ArticleMapper;
import com.hl.pojo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService{
    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public Integer add(Article article) {
        return articleMapper.add(article);
    }

    @Override
    public Integer del(Integer id) {
        return articleMapper.del(id);
    }

    @Override
    public List<Article> findAll() {
        return articleMapper.findAll();
    }

    @Override
    public List<Article> findByName(Article article) {
        return articleMapper.findByName(article);
    }

    @Override
    public List<Article> findByCategory(Integer categoryId) {
        return articleMapper.findByCategory(categoryId);
    }

    @Override
    public List<Article> findByConsultantId(Integer consultantId) {
        return articleMapper.findByConsultantId(consultantId);
    }

    @Override
    public Integer update(Article article) {
        return articleMapper.update(article);
    }
}
